#include <bits/stdc++.h>

using namespace std;

priority_queue<long long, vector<long long>, greater<long long> > pq;

/*string f(long long num) {
    if (num == 0) return "0";
    string binary;
    while (num > 0) {
        binary = (num % 2 == 0 ? "0" : "1") + binary;
        num /= 2;
    }
    return binary;
}*/

bool check(long long x){
    while(x % 2 == 0){
        x /= 2;
    }
    return x == 1 ? true : false;
}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int t;
    cin >> t;
    long long num;
    while(t--){
        cin >> num;
        for(long long i = (1ll << 62); i >= 1; i >>= 1){
            if(num >= i){
                num -= i;
                pq.push(i);
            }
        }
        int cnt = 0;
        while(!check(cnt + pq.size())){
            int tmp = pq.top();
            pq.pop();
            if(tmp == 1)    cnt++;
            else{
                pq.push(tmp / 2);
                pq.push(tmp / 2);
            }
        }
        for(int i = 1; i <= cnt; i++){
            cout << 1 << " ";
        }
        while(!pq.empty()){
            cout << pq.top() << " ";
            pq.pop();
        }
        cout << "\n";
    }
    return 0;
}